#include <stdlib.h>
#include <stdio.h>

int main()
{
	unsigned int a = 0xaabbccdd;
	unsigned char c;

	printf("a=0x%x\n",a);
	c = *((char*)(&a));
	printf("c=0x%x\n",c);
	if(c==0xdd)
	{
		printf("little endian.\n",c);
	}
	else if(c==0xaa)
	{
		printf("big endian.\n");
	}
	else
	{
		printf("unkown cpu endian!\n");
	}

	char *addr = (char*)(&a);
	printf("addr:0x%x,data:0x%x\n",addr,*addr);
	printf("addr:0x%x,data:0x%x\n",addr+1,*(addr+1));
	printf("addr:0x%x,data:0x%x\n",addr+2,*(addr+2));
	printf("addr:0x%x,data:0x%x\n",addr+3,*(addr+3));

	return 0;
}

